package cn.accp.fruitWar.baseEntity;

/**
 * 水果类
 * 
 * @author Jiangqs
 * 
 */
public abstract class Fruit {
	// 水果名
	private String name;
	// 颜色
	private String color;
	// 重量
	private double weight;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	public double getWeight() {
		return weight;
	}

	public void setWeight(double weight) {
		if (weight > 0) {
			this.weight = weight;
		} else {
			this.weight = 0.1;
		}
	}

	/**
	 * 水果飞起来
	 */
	public abstract void fly();

	/**
	 * 水果切开之后的动作
	 */
	public abstract void cut();

	public Fruit() {
	}

	public Fruit(String name, String color, double weight) {
		this.name = name;
		this.color = color;
		setWeight(weight);
	}

	public Fruit(Fruit fruit) {
		this.name = fruit.name;
		this.color = fruit.color;
		this.weight = fruit.weight;
	}
}
